package com.ys.extendsdemo;

/**
 * 父类:----超类
 * @author CodeYang
 * @version 2020/12/15 11:57
 */
public class Superclass {

    private String name;
    private int age;
    private String address;

    public Superclass() {
    }

    public Superclass(String name, int age, String address) {
        this.name = name;
        this.age = age;
        this.address = address;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    void show() {
        String str = "Superclass{" +
                "name='" + name + '\'' +
                ", age='" + age + '\'' +
                ", address='" + address + '\'' +
                '}';
        System.out.println("show---父类"+str);
    }

    @Override
    public String toString() {
        return "Superclass{" +
                "name='" + name + '\'' +
                ", age='" + age + '\'' +
                ", address='" + address + '\'' +
                '}';
    }
}
